home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK2.toast / Development Kits (Disc 2) / Word Services SDK 1.0.8 / Writeswell Jr 1.2.3 Sources ƒ / Library Source / UserItem.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-19  |  886 b   |  43 lines  |  [TEXT/CWIE]

  1. /* UserItem.c
  2.  * Handy utilities for manipulating user items.
  3.  * Copyright ©1997 Crawford Software Consulting.  All Rights Reserved.
  4.  * 19 Jan 97 Mike Crawford crawford@scruznet.com http://www.scruznet.com/~crawford/
  5.  * 
  6.  * Get the Word Services Software Development Kit from http://www.wordservices.org/
  7.  */
  8.  
  9. #include "UserItem.h"
  10.  
  11. void InstallUserItemProc( DialogPtr dlg, short item, ProcPtr userProc )
  12. {
  13.     short        kind;
  14.     Handle        h;
  15.     Rect        r;
  16.     UserItemUPP    proc;
  17.  
  18.     GetDItem( dlg, item, &kind, &h, &r );
  19.     
  20.     proc = NewUserItemProc( userProc );
  21.     if ( !proc )
  22.         return;                // STUB should report an error 
  23.  
  24.  
  25.     SetDItem( dlg, item, kind, (Handle)proc, &r );
  26.  
  27.     return;
  28. }
  29.  
  30. void DestroyUserItemProc( DialogPtr dlg, short item )
  31. {
  32.     short        kind;
  33.     Handle        h;
  34.     Rect        r;
  35.  
  36. #ifdef GENERATINGCFM
  37.     GetDItem( dlg, item, &kind, &h, &r );
  38.  
  39.     DisposeRoutineDescriptor( (UniversalProcPtr)h );
  40. #endif
  41.     return;
  42. }
  43.